<block name="main">
    <div class="panel panel-primary" id="js_album">
        <div class="panel-heading">
            图片展示  &nbsp;
            <button type="submit" class="btn btn-default" id="js_addphoto">添加图片</button>
        </div>
        <div class="panel-body">
            <notempty name="list">
                <foreach name="list" item="v">
                    <div class="col-xs-12 col-sm-6 col-md-4">
                        <div class="thumbnail">
                            <img src="__ROOT__{$v['name']}" alt="" style="height:350px;">
                        </div>
                    </div>
                </foreach>
                <else/>
                没有图片
            </notempty>
        </div>
    </div>
    <div class="modal fade" id="myModal1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">添加图片</h4>
                </div>
                <div class="modal-body">
                    <form action="{:U('Index/addphoto')}" method="post" enctype="multipart/form-data">
                        <div class="form-group">
                            <label for="exampleInputFile">图片</label>
                            <input type="hidden" name="id" value="{$id}"/>
                            <input type="file" id="exampleInputFile" name="face"/>
                            <p class="help-block">Example block-level help text here.</p>
                        </div>
                        <button type="submit" class="btn btn-primary">添加</button>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <script>
        $("#js_addphoto").click(function(){
            $('#myModal1').modal('show');
        })
    </script>
</block>